<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">

       
        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>

         <ui:define name="TituloModulo">
            Gestão de Financeira
        </ui:define>
        

        <ui:define name="TituloConteudoPrincipal">
            Alterar Movimento
        </ui:define>


        <ui:define name="ConteudoPrincipal">

            <p:messages globalOnly="true"/>
            <h:form>
                <h:panelGrid columns="3">

                    <h:outputLabel value="#{bundle.codDocumento}" for="codDocumento" />
                    <p:inputText id="codDocumento" value="#{movimentoController.selected.codDocumento}" title="#{bundle.codDocumento}" required="true" requiredMessage="#{bundle.obrigatorio}"/>
                    <p:message for="codDocumento" />

                    <h:outputLabel value="#{bundle.dataMovimento}" for="dataMovimento" />
                    <p:calendar id="dataMovimento" value="#{movimentoController.selected.dataMovimento}" title="#{bundle.dataMovimento}" required="true"  disabled="true" requiredMessage="#{bundle.dataMovimento}" pattern="MM/dd/yyyy HH:mm:ss"/>
                    <p:message for="dataMovimento" />

                    <h:outputLabel value="#{bundle.dataDocumento}" for="dataDocumento" />
                    <p:calendar id="dataDocumento"  value="#{movimentoController.selected.dataDocumento}" title="#{bundle.dataDocumento}" required="true" requiredMessage="#{bundle.dataDocumento}" showButtonPanel="true" pattern="MM/dd/yyyy" navigator="treu" locale="pt_BR" />
                    <p:message for="dataDocumento" />

                    <h:outputLabel value="#{bundle.descricao}" for="descricao" />
                    <p:inputText id="descricao" value="#{movimentoController.selected.descricao}" title="#{bundle.descricao}" required="true" requiredMessage="#{bundle.descricao}"/>
                    <p:message for="descricao" />

                    <h:outputLabel value="#{bundle.nomeUsuario}" for="idLogin" />
                    <p:selectOneMenu id="idLogin" value="#{movimentoController.selected.idLogin}" disabled="true" required="true" requiredMessage="#{bundle.idLogin}">
                        <f:selectItems value="#{loginUsuarioController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="idLogin" />

                </h:panelGrid>
                <p:commandButton ajax="false" action="#{movimentoController.update}" value="#{bundle.salvar}"/>
                &nbsp;
                <p:commandButton ajax="false" action="#{movimentoBean.prepararRegistoMovimento}" value="#{bundle.criar}" immediate="true"/>
                &nbsp;
                <p:commandButton ajax="false" action="listarMovimento" value="#{bundle.listar}" immediate="true" />

            </h:form>
        </ui:define>
    </ui:composition>

</html>
